package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {
    /**
    *倚窗听喧嚣
    *2020/5/14
    *$根据分类名称查询品牌信息
    */
    //添加查询注解
    @Select("SELECT a.* FROM tb_brand a JOIN tb_category_brand b ON a.id = b.brand_id JOIN tb_category c ON c.id = b.category_id where c.name = #{cateName}")
    List<Brand> findBrandByCateName(String cateName);
}
